<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<%@ include file="/common/import.jsp" %>
<c:if test="${bidSession.sessionType=='1'}"><c:set var="titleName" value="专厅"/></c:if>
<c:if test="${bidSession.sessionType=='2'}"><c:set var="titleName" value="专场"/></c:if>
<c:if test="${bidSession.sessionType=='3'}"><c:set var="titleName" value="专组"/></c:if>
<title>${titleName}管理-${sysName}</title>
<script>
  var thsTitle = "${titleName}管理";
  var objName="item";
  var currentObjId = "";
  var sessionId = "${bidSession.sessionId}";
  var direction  = "${bidSession.direction}";
</script>
<script type="text/javascript" src="${ctx}/js/zbxupload.js"></script> 
<script type="text/javascript" src="${ctx}/js/date.js"></script> 
</head>
<body class="home-template2">
<!-- 正文开始 -->

<table  class="info" cellspacing="1" cellpadding="0">
	<tr>
		<th width='80'>${titleName}名称</th>
		<td id="bSessName" title="${bidSession.sessionName}"><script type="text/javascript">document.getElementById("bSessName").innerHTML +=strUtil.subStr('${bidSession.sessionName}',20);</script></td>
		<th width='80'>竞价方式</th>
		<td id="bSessMode"><script type="text/javascript">document.getElementById("bSessMode").innerHTML += bidModeText('${bidSession.sessionMode}');</script></td>
		<th width='80'>报价服务器</th>
		<td><span id="bjserverSpan">${bidPub.bjServer}:${bidPub.bjPort}</span>
		<div id="updBjserverDiv" style="display: none;">
			<form action="" id="updBjserverForm">
			<input type="hidden" name="pubId"  value="${bidPub.pubId}"/>
			<input type="hidden" name="bjServer"  value=""/>
			<input type="hidden" name="bjPort"  value=""/>
			<select  id="bjServerStr" name="bjServerStr" onchange="bjServerChange()" /></select><br/>
			<a onclick="editBjserver('${bidPub.pubId}');"  class="fDef_Btn">修改</a>
			<a onclick="cancelEditBjs();"  class="fDef_Btn">取消</a>
			</form>
			</div>
		</td>
		<td style="height:10px;width:150px;" rowspan="2">
		<span id="sessPicSpan">
		  <c:if test="${empty bidSession.picUrl}"><img style="width:100%;" src="${ctx}/images/def.jpg"/></c:if>
		  <c:if test="${!empty bidSession.picUrl}"><a href="${bidSession.picUrl}" target="_blank" title="查看大图"><img style="height:100px;width:100%;" src="${bidSession.picUrl}"/></a></c:if>
		</span>
		<div msg="第1组" id="updPicDiv" style="display:none;">
			<form id="updPicForm" action="">
			<input type="hidden" name="sessionId" id="sessionId" value="${bidSession.sessionId}">
			  <c:if test="${empty bidSession.picUrl}"><img id="fileUpText_1_showImg" src="${ctx}/images/def.jpg" style="height:80px;" /></c:if>
			  <c:if test="${!empty bidSession.picUrl}"><img id="fileUpText_1_showImg" src="${bidSession.picUrl}" style="height:80px;" /></c:if>
			  <label onclick="addUploadFile(1);" for="uploadFileInput" class="fDef_Btn" >选择文件</label>
			  <label id="fileUpText_1_subbtn" onclick="$.zbxupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse" >开始上传</label>
			  <input id="fileUpText_1" name="picUrl" type="hidden" class="fDef_Input" > <!-- 此元素的name="attaUrl" 对照修改后台属性，以备入库 -->
			  <a onclick="editPic('${bidSession.sessionId}')"  class="fDef_Btn">提交</a>
			</form>
		</div>
		</td>
	</tr>
	<tr>
		<th>控制方式</th>
		<td id="bidBCtrl"><script type="text/javascript">document.getElementById("bidBCtrl").innerHTML += bailCtrlText('${bidSession.bailCtrl}');</script></td>
		<th>创建时间</th>
		<td>${bidSession.createTime}</td>	
		<th>${titleName}状态</th>
		<td id="pubStatus">
			<span id="span_stat0" style="display:none;">待发布 <a style="color:red;" onclick="pubSession()">发布到网站</a>&nbsp;<a style="color:red;" onclick="editOpen()">修改${titleName}信息</a>
			<br/><a style="color:red;" onclick="editBjserverOpen()">修改报价服务器</a></span>
			<span id="span_stat2" style="display:none;">已发布 <a style="color:red;" onclick="pauseSession()">暂停</a></span>
			<span id="span_stat3" style="display:none;">暂停中 <a style="color:red;" onclick="continueSession()">重新发布</a>
			<a style="color:red;" onclick="editBjserverOpen()">修改报价服务器</a></span>
			
		    <a style="color:red;" onclick="editPicOpen()">修改${titleName}图片</a>
		</td>			
	</tr>	
</table>
<br>
<c:if test="${bidSession.status==0}">
<div class="easyui-dialog" id="upd_window" title="修改专场信息" closed="true" modal="true" style="width:900px;height:350px;">
<form id="updForm" onsubmit="">
<table class="info" cellspacing="1" cellpadding="0"  id="updTable" style="display: none;">
	<input type="hidden" name="sessionId" id="sessionId" value="${bidSession.sessionId}">
	<input type="hidden" name="direction" value="${bidSession.direction}">
	<tr>
		<th>${titleName}名称：<font color="red">*</font></th>

		<td><input type="text" name="sessionName" id="sessionName" class="easyui-validatebox validatebox-text" 
			validtype="length[1,66]"	required="true"  missingMessage="请输入专厅名称"  maxlength="100"
				invalidMessage="最多可输入66中文字符"  title="最多可输入66中文字符"  size="80" value="${bidSession.sessionName}"/>
		</td>

	</tr>
	
	<tr>
		<th>竞价开始时间：<font color="red">*</font></th>
		<td>
			<input type="hidden" name="openTime" id="sessionOpenTime" value="${bidSession.openTime}" size="20"  /> 
			    <select class="myDate" size=1 id=sessionOpenTime_y></select>年
				<select class="myDate" size=1 id=sessionOpenTime_m></select>月
				<select class="myDate" size=1 id=sessionOpenTime_d></select>日
				<select class="myTime" size=1 id=sessionOpenTime_hh></select>时
				<select class="myTime" size=1 id=sessionOpenTime_mm></select>分
				<select class="myTime" size=1 id=sessionOpenTime_ss></select>秒
		</td>
	</tr>
	
	
	
	<tr>
		<td colspan="2" style="text-align:center;">
			<a class="easyui-linkbutton" id="editButton" iconCls="icon-add" onclick="edit('${bidSession.sessionId}');">修改</a>
			<a class="easyui-linkbutton" id="editButton" iconCls="icon-add" onclick="javascript:window.location.reload(true)">关闭</a>
		</td>
	</tr>
</table>
</form>
</div>
</c:if>
<!-- tab begin -->
<div  id="main">
<!-- tab1 -->
<div title="专场介绍">
<form id="addBuyerForm">
	<%-- <input type="hidden" name="sessionId"  value="${bidSession.sessionId}"/> --%>
	<input type="hidden" name="pubId"  value="${bidPub.pubId}"/>
	<!-- <input type="hidden" name="bjServer"  value=""/> -->
	<table class="info" cellspacing="1" cellpadding="0"/>
		 <tr style="display:none;">
			<th>竞买人审核：</th>
			<td>
				<input type="radio" name="auditLevel"  value="1" <c:if test="${bidPub.auditLevel == '1'}"> checked="checked" </c:if> /> 不需要审核，直接交纳保证金<br/>
				<input type="radio" name="auditLevel"  value="2" <c:if test="${bidPub.auditLevel == '2'}"> checked="checked" </c:if> /> 需要审核，资格通过后交纳保证金
			</td>
		</tr>
		<tr style="display:none;">
			<th>是否需要交易密码：</th>
			<td>
				<input type="radio" name="ifPassword"  value="F" <c:if test="${bidPub.ifPassword != 'T'}"> checked="checked" </c:if> /> 不需要，
				<input type="radio" name="ifPassword"  value="T" <c:if test="${bidPub.ifPassword == 'T'}"> checked="checked" </c:if> /> 需要
			</td>
		</tr>
		<tr style="display:none;">
			<th>竞买人是否需要上传资料：</th>
			<td>
				<input type="radio" name="ifUpload"  value="F" <c:if test="${bidPub.ifUpload != 'T'}"> checked="checked" </c:if> /> 不需要，
				<input type="radio" name="ifUpload"  value="T" <c:if test="${bidPub.ifUpload == 'T'}"> checked="checked" </c:if> /> 需要
			</td>
		</tr>
		<tr style="display:none;">
			<th>需要上传资料说明：</th>
			<td><textarea cols=80 rows=5 id="uploadDesc" name="uploadDesc" >${bidPub.uploadDesc}</textarea></td>
		</tr>
		<tr>
			<th>${titleName}介绍：</th>
			<td><textarea cols=80 rows=5 id="infoDesc" style="font-size: 12px;" name="infoDesc" >${bidPub.infoDesc }</textarea></td>
		</tr>
		<tr>			
			<td colspan="2" style="text-align:center;">
				<a class="easyui-linkbutton" iconCls="icon-add" onclick="savePub('${bidPub.pubId}');">保存</a>
			</td>
		</tr>
	</table>
	</form>	
</div>
<!-- tab7  -->
<c:if test="${bidSession.ifGroup == 'T' }">
<div title="${titleName}标的分组" style="padding:10px;">
	<div class="searchForm"><form id="groupList_form">
		<input type="hidden" name="page"  value="1">
		<input type="hidden" name="rows"  value="5">
		<input type="hidden" name="sessionId"  value="${bidSession.sessionId}">
		分组名称：<input type="text" name="groupName"  value="" /> 
		<a class="easyui-linkbutton"  iconCls="icon-search" onclick="groupListSearch();">查询</a>
		<a class="easyui-linkbutton"  iconCls="icon-search" onclick="clearFormById('groupList_form');">清空</a>
	</form></div>
	<table id="groupList_table" class="info" cellspacing="1" cellpadding="0">
		<tr class='active' id="title2" >
			<th width='5%'>分组序号</th>
			<th width='5%'>分组编号</th>
			<th width='30%'>标的分组名称</th>
			<th width='30%'>竞价开始时间</th>
			<th width='10%' class='th_center'>操作</th>
		</tr>
	</table>
	<div class="page" id="groupList_page"></div>
	<script type="text/template" id="groupList_html">
	<? for ( var i = 0; i < rows.length; i++) {?>
		<tr id=group_<?=rows[i].groupId?>>
			<td><?=i+1?></td>
			<td><?=rows[i].groupCode?></td>
			<td><?=rows[i].groupName?></td>
            <td><?=rows[i].openTime?></td>
			<td>
				<a class="mybutton"  onclick="delGroup('<?=rows[i].groupId?>');">删除</a> 
			</td>
		</tr>
	<?}?>  		
	</script>
	<div class="searchForm"><form id="groupAddForm">
		<input type="hidden" name="sessionId"  value="${bidSession.sessionId}">
		分组编号：<input type="text" name="groupCode"  value="" class="easyui-validatebox validatebox-text" 
			validtype="length[1,50]"	required="true"  missingMessage="请输入分组编号"  maxlength="55"
				invalidMessage="最多可输入50个字符"  title="分组编号最多可输入50个字符" /> 
		分组名称：<input type="text" name="groupName"  value="" class="easyui-validatebox validatebox-text" 
			validtype="length[1,33]"	required="true"  missingMessage="请输入分组名称"  maxlength="55"
				invalidMessage="最多可输入33个中文字符"  title="分组名称最多可输入33个中文字符" /> 
		开始时间：<input type="hidden" id="groupOpenTime" name="openTime"  value="${bidSession.openTime}" />
				<select class="myDate" size=1 id=groupOpenTime_y></select>年
				<select class="myDate" size=1 id=groupOpenTime_m></select>月
				<select class="myDate" size=1 id=groupOpenTime_d></select>日
				<select class="myTime" size=1 id=groupOpenTime_hh></select>时
				<select class="myTime" size=1 id=groupOpenTime_mm></select>分
				<select class="myTime" size=1 id=groupOpenTime_ss></select>秒
		<a class="easyui-linkbutton"  iconCls="icon-add" onclick="addGroup();">增加新的分组</a>
		<a class="easyui-linkbutton"  iconCls="icon-no" onclick="clearFormById('groupAddForm');">清空</a>
	</form></div>
</div>
</c:if>
<!-- tab2  -->	
<div title="新增标的">
	<form id="addItemForm">
	<input type="hidden" name="sessionId"  value="${bidSession.sessionId}"/>
	<input type="hidden" name="sessionType"  value="${bidSession.sessionType}"/>
	<input type="hidden" name="sessionName"  value="${bidSession.sessionName}"/>
	<input type="hidden" name="orgEname"  value="${bidSession.orgEname}"/>
	<input type="hidden" name="orgCname"  value="${bidSession.orgCname}"/>
	<input type="hidden" name="bidMode"  value="${bidSession.sessionMode}"/>
	<input type="hidden" name="ifBidDyn"  value="${bidSession.ifBidDyn}"/>
	<input type="hidden" name="direction" value="${bidSession.direction}">
	<input type="hidden" name="itemStatus"  value=""/>
	<input type="hidden" name="incrementGroup"  value=""/>
	<c:if test="${bidSession.ifGroup != 'T' }">
		<input type="hidden" name="groupId"  value="0"/>
		<input type="hidden" name="groupName"  value="--"/>
	</c:if>
	<c:if test="${bidSession.serialCtrl!='T'}">
		<input type="hidden" name="orderNumber"  value="0"/>
	</c:if>
	<table class="info" cellspacing="1" cellpadding="0"/>
	<c:if test="${bidSession.serialCtrl=='T'}">
	   <tr>
			<th>标的序号：</th>
			<c:set var="Onum" value="${maxOrderNumber+1}"></c:set>
			<td><input type="hidden" id="orderNumber" name="orderNumber"  value="${Onum}" size="2"  onchange="checkNumber(this.value)"  />第<font id="orderNumberTxt">${Onum}</font>个标的 </td>
		</tr>
	</c:if>
		<tr>
			<th>标的名称：</th>
			<td><input type="text" name="itemName"  value="" size="80" maxlength="40" class="easyui-validatebox validatebox-text" 
			validtype="length[1,60]"	required="true"  missingMessage="请输入标的名称"  
				invalidMessage="最多可输入60中文字符"  title="标的名称最多可输入60中文字符" /> </td>
		</tr>
		<tr>
			<th>特别说明：</th>
			<td><input type="text" name="spare1"  value="" size="80" maxlength="40" class="easyui-validatebox validatebox-text" 
			validtype="length[1,40]" missingMessage="请输入标的特别说明"  
				invalidMessage="最多可输入40中文字符"  title="标的特别说明最多可输入40中文字符" /> </td>
		</tr>
		<c:if test="${bidSession.ifGroup == 'T' }">
        <tr>
			<th>标的分组：</th>
			<td><input type="text" name="groupId" id="groupIdCombo" value="" size="80"/> 
			  <input type="hidden" name="groupName" id="groupNameCombo" value="" />
			</td>
		</tr>
		</c:if>
		
        <tr>
			<th>标的类型：</th>
			<td><input type="text" name="itemType" id="itemType" value="" size="80"/> 
			</td>
		</tr>
		<tr>
			<th>货币单位/币种：</th>
			<td>
				<select name="priceUnit" id="priceUnit" value=""><option value="元">元</option><option value="万元">万元</option></select>
				<input name="currency" id="currency" value="" size="10"/>
			</td>
		</tr>
		<tr>
			<th>起始价格：</th>
			<td>
				<input type="text" name="firstValuePre" id="firstValuePre" value="" size="18" maxlength="10" onchange="changePrice();" onblur="changeDecimal('firstValuePre');" class="easyui-validatebox validatebox-text" 
			validtype="number"	required="true"  missingMessage="请输入起始价格"  invalidMessage="必须为非负的数字"  title="请输入起始价格" /> 
				<select name="decimalCount" id="decimalCount"><option value="0">0位</option><option value="1">1位</option><option value="2" selected>2位</option><option value="3">3位</option><option value="4">4位</option><option value="5">5位</option><option value="6">6位</option></select><font color="red">(保留小数位)</font>
			</td>
		</tr>
		<c:if test="${bidSession.sessionMode == '6'}">
		<tr>
			<th>竞价总量：</th>
			<td><input type="text" name="itemNum" id="itemNum"  value="" size="30"  maxlength="10"  class="easyui-validatebox validatebox-text" 
			validtype="number"	required="true"  missingMessage="请输入竞价总量"  invalidMessage="必须为非负的数字"  title="请输入竞价总量" /> </td>
		</tr>
		</c:if>
		<tr>
			<th>报价幅度：</th>
			<td><input type="text" name="incrementValue" id="incrementValue"  value="" size="30"  maxlength="10" onchange="changePrice();" onblur="changeDecimal('incrementValue');" class="easyui-validatebox validatebox-text" 
			validtype="number"	required="true"  missingMessage="请输入报价幅度"  invalidMessage="必须为非负的数字"  title="请输入加价幅度" /> </td>
		</tr>
		
		<c:if test="${bidSession.sessionMode != '7'}">
		<tr>
			<th>是否允许报起始价：</th>
			<td>
				<input type="radio" name="allowFirstValue" value="T" checked="checked" >是，从起始价<font id="fv1"></font>开始报价，
				<input type="radio" name="allowFirstValue" value="F">否，从起始价之上一个加价幅度<font id="fv2"></font>开始报价
			</td>
		</tr>
		</c:if>		
		
		<tr id="openTimePreTr">
			<th>竞价开始时间：</th>
			<td>
				<input type="hidden" name="openTimePre" id="openTimePre" value="" size="20" /> 
				<span id="openTimePre_dt">
				<select class="myDate" id=openTimePre_y></select>年
				<select class="myDate" id=openTimePre_m></select>月
				<select class="myDate" id=openTimePre_d></select>日
				<select class="myTime" id=openTimePre_hh></select>时
				<select class="myTime" id=openTimePre_mm></select>分
				<select class="myTime" id=openTimePre_ss></select>秒
				</span>
				<a id="defineTxt" onclick="notDefine()">待定: 以后再设定竞价开始时间和结束时间</a>
			</td>
		</tr>
		<c:if test="${bidSession.sessionMode != '7'}">
		<tr id="firstBidTimePreTr">
			<th>${(bidSession.sessionMode=='1'||bidSession.sessionMode=='2')?'限时开始时间':'竞价结束时间'}：</th>
			<td>
			<!-- input type="text" name="firstBidTimePre"  id="firstBidTimePre" value="" size="20" readonly="true" showSeconds="true" required="true" editable="false" class="easyui-datetimebox" /> --> 
			<input type="hidden" name="firstBidTimePre" id="firstBidTimePre" value="" size="20" /> 
				<div id="firstBidTimePre_dt">
				<select class="myDate" id=firstBidTimePre_y></select>年
				<select class="myDate" id=firstBidTimePre_m></select>月
				<select class="myDate" id=firstBidTimePre_d></select>日
				<select class="myTime" id=firstBidTimePre_hh></select>时
				<select class="myTime" id=firstBidTimePre_mm></select>分
				<select class="myTime" id=firstBidTimePre_ss></select>秒
				</div>
			</td>
		</tr>
		</c:if>
		<c:if test="${bidSession.sessionMode == '7'}">
		<input type="hidden" name="firstBidTimePre"  id="firstBidTimePre">
		<input type="hidden" name="allowFirstValue"  value="T">
		</c:if>
		
		<c:if test="${bidSession.sessionMode == '1' || bidSession.sessionMode =='2' || bidSession.sessionMode =='7'}">
		<tr>
			<th>${(bidSession.sessionMode!='7')?'限时报价周期':'荷兰降價价周期'}：</th>
			<td><input type="text" name="limitTime" id="limitTime"  value="${bidSession.limitTime == null ? 60 : bidSession.limitTime}" size="4"  maxlength="4"  class="easyui-validatebox validatebox-text" 
			validtype="number"	required="true"  missingMessage="请输入限时报价周期"  invalidMessage="必须为1~4位非负数字"  title="限时报价周期"  onblur="if(this.value=='') {this.value='60';}"  />（秒） </td>
		</tr>
		</c:if>
		<c:if test="${bidSession.sessionMode == '3' || bidSession.sessionMode =='4'|| bidSession.sessionMode =='5'|| bidSession.sessionMode =='6'}">
			<tr>
			<th>允许修改次数【${bidSession.sessionMode }】：</th>
			<td>
				<input type="hidden" name="limitTime" id="limitTime" value="0"/>
				<input type="text" name="allowUpdateTimes" id="allowUpdateTimes"  value="0" size="4" maxlength="4"  class="easyui-validatebox validatebox-text" 
				validtype="number"	required="true"  missingMessage="请输入允许修改次数"  invalidMessage="必须为1~4位非负数字"  title="允许修改次数"  />
			</td>
		</tr>
		</c:if>
		<tr>
			<th>标的主图：</th>
			<td>
				<div msg="第1组" id="updPicDiv2">
					  <img id="fileUpText_2_showImg" src="${ctx}/images/def.jpg" style="height:80px;" />
					  <label onclick="addUploadFile(2);" for="uploadFileInput" class="fDef_Btn" >选择文件</label>
					  <label id="fileUpText_2_subbtn" onclick="$.zbxupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse" >开始上传</label>
					  <input id="fileUpText_2" name="picUrl" type="hidden" class="fDef_Input" > <!-- 此元素的name="attaUrl" 对照修改后台属性，以备入库 -->
				</div>
			</td>
		</tr>
		<tr>			
			<td colspan="2" style="text-align:center;">
				<a class="easyui-linkbutton" iconCls="icon-add" id="addItemButt" onclick="addItem('0');">保存</a>
				<a class="easyui-linkbutton" iconCls="icon-add" onclick="addItem('2');" id="itemAddAndPub" <c:if test="${bidSession.status != 2}"> style="display:none;" </c:if> >保存并发布</a>
				<!--  a class="easyui-linkbutton" iconCls="icon-no" onclick="clearFormById('addItemForm');">清空</a>-->
			</td>
		</tr>
	</table>
	</form>	
</div>
<!-- tab3  -->
<div title="未开始的标的" style="padding:10px;" >
	<div class="searchForm"><form id="notBeginList_form">
		<input type="hidden" name="page"  value="1">
		<input type="hidden" name="rows"  value="5">
		<input type="hidden" name="sessionId"  value="${bidSession.sessionId}">
		<!-- 存在currentTimePre隐藏域时，不需要 itemStatus参数(底层已存在)，否则查询条件会发生冲突 -->
		<input type="hidden" name="currentTimePre"  value="">
		标的名称：<input type="text" name="itemName"  value="" /> 
		<!-- 发布状态：<select name="itemStatus">
		<option value="">所有</option>
		<option value="0">未发布</option>
		<option value="2">已发布</option>
		<option value="3">暂停中</option>
		</select> -->
		<a class="easyui-linkbutton"  iconCls="icon-search" onclick="notBeginListSearch();">查询</a>
		<a class="easyui-linkbutton"  iconCls="icon-search" onclick="clearFormById('notBeginList_form');">清空</a>
	</form></div>
	<table id="notBeginList_table" class="info" cellspacing="1" cellpadding="0" >
		<tr class='active' id="title2" >
			<c:if test="${bidSession.serialCtrl=='T'}">
	   			<th width='3%'>序号</th>
			</c:if>		
			<th width='20%'>标的名称</th>
			<th width='10%'>起始价格</th>
			<th width='15%'>竞价开始时间</th>
			<c:if test="${bidSession.sessionMode !='7'}">
			<th width='15%'>限时开始时间</th>	
			</c:if>
			<th width='5%'>发布状态</th>
			<th width='30%' class='th_center'>操作</th>
		</tr>
	</table>
	<div id="notBeginList_page" class="page"></div>
	<script type="text/template" id="notBeginList_html">
	<? for ( var i = 0; i < rows.length; i++) {?>
		<tr id=item_<?=rows[i].itemId?>>
			<c:if test="${bidSession.serialCtrl=='T'}">
	   			<td><?=rows[i].orderNumber?></td>
			</c:if>	
			<td title=<?=rows[i].itemName?>><?=strUtil.subStr(rows[i].itemName,16)?></td>
			<td><?=rows[i].firstValuePre?>  <?=rows[i].priceUnit?></td>
			<td>
				<?if(rows[i].openTimePre=='2050-12-31 23:59:59'){?>
					待定 
					<?if(rows[i].orderNumber=='0' || rows[i].orderNumber=='1'){?>
						<a onclick="beginIt('<?=rows[i].itemId?>','<?=rows[i].itemName?>')">设定竞价时间</a>
					<?}?>
				<?}else{?>
					<?=rows[i].openTimePre?>
				<?}?>
			</td>
			<?if('${bidSession.sessionMode}'!='7'){?>
			<td>
				<?if(rows[i].firstBidTimePre=='2050-12-31 23:59:59'){?>
					待定
				<?}else{?>
					<?=rows[i].firstBidTimePre?>
				<?}?>
			</td>
			<?}?>
			<td><?=itemStatusTxt(rows[i].itemStatus)?></td>
			<td>

				<a class="mybutton"  onclick="itemBase('<?=rows[i].itemId?>');">基本信息</a>  
				<?if('${bidSession.sessionMode}'!='7'){?>
				    <!-- || <a class="mybutton"  onclick="itemRule('<?=rows[i].itemId?>','<?=rows[i].itemName?>');">高级规则</a>
						--> 
				<?}?>
				<?if(rows[i].itemStatus==0 || rows[i].itemStatus==1){?>
				     || <a class="mybutton"  onclick="pubItem('<?=rows[i].itemId?>');">发布</a>  
					 || <a class="mybutton"  onclick="del('<?=rows[i].itemId?>');">删除</a>
				<?}?>
				<?if('${bidSession.sessionType}'=='3'){?>
					 || <a class="mybutton"  onclick="goApply('<?=rows[i].itemId?>','<?=rows[i].itemName?>');">竞买人管理</a>
				<?}?>
<!-- 
					 || <a class="mybutton"  onclick="goPic('<?=rows[i].itemId?>','<?=rows[i].itemName?>');">图</a>
--> 
			</td>
		</tr>
   <?}?>  		
</script>
</div>
<!-- tab4  -->	
<div title="进行中的标的" style="padding:10px;">
	<div class="searchForm"><form id="runningList_form">
		<input type="hidden" name="page"  value="1">
		<input type="hidden" name="rows"  value="5">
		<input type="hidden" name="sessionId"  value="${bidSession.sessionId}">
		<input type="hidden" name="currentTimePre"  value="">
		标的名称：<input type="text" name="itemName"  value="" /> 
		<!-- 发布状态：<select name="itemStatus">
		<option value="">所有</option>
		<option value="B">自由报价期</option>
		<option value="C">限时报价期</option>
		</select> -->
		<a class="easyui-linkbutton"  iconCls="icon-search" onclick="runningListSearch();">查询</a>
		<a class="easyui-linkbutton"  iconCls="icon-search" onclick="clearFormById('runningList_form');">清空</a>
	</form></div>
	<table id="runningList_table" class="info" cellspacing="1" cellpadding="0">
		<tr class='active' id="title2" >
			<th width='20%'>标的名称</th>
			<th width='8%'>起始价格</th>
			<th width='10%'>当前价格</th>	
			<th width='5%'>报价次数</th>
			<th width='15%'>最高报价人</th>
			<th width='8%'>竞价状态</th>		
			<th width='30%' class='th_center'>操作</th>
		</tr>
	</table>
	<div id="runningList_page" class="page"></div>
	<script type="text/template" id="runningList_html">
	<? for ( var i = 0; i < rows.length; i++) {?>
       
		<tr id=item_<?=rows[i].itemId?>>
			<td style="color:blue;">
           <?=strUtil.subStr(rows[i].itemName,15)?>
           <input type=hidden name=ids value=<?=rows[i].itemId?> ></td>
			<td><?=rows[i].firstValue?>  <?=rows[i].priceUnit?></td>
			<td><?=rows[i].lastValue?>  <?=rows[i].priceUnit?></td>
			<td><?=rows[i].bidTimes?></td>
			<td><?=strUtil.doNull(rows[i].userName)?></td>
			<td><?=itemStatusTxt(rows[i].itemStatus)?></td>
			<td>
				<a class="mybutton"  onclick="itemBase('<?=rows[i].itemId?>');">基本信息</a> 
				<?if('${bidSession.sessionMode}'!='7'){?>
				  <!--   || <a class="mybutton"  onclick="itemRule('<?=rows[i].itemId?>','<?=rows[i].itemName?>');">高级规则</a>--> 
				<?}?> 
					 || <a class="mybutton"  onclick="viewRecord('<?=rows[i].itemId?>');">报价记录</a>  
					 || <a class="mybutton"  onclick="compareCache('<?=rows[i].itemId?>');">比缓存</a>  
                <?if(rows[i].itemStatus==2){?>
					 || <a class="mybutton"  onclick="pauseItem('<?=rows[i].itemId?>');">暂停</a>
                <?}else if(rows[i].itemStatus==3){?>
					 || <a class="mybutton"  onclick="continueItem('<?=rows[i].itemId?>','<?=rows[i].firstBidTimePre?>');">继续</a>
					<!-- || <a class="mybutton"  onclick="goPic('<?=rows[i].itemId?>','<?=rows[i].itemName?>');">图</a> 
-->
				<?}?>
				<?if('${bidSession.sessionType}'=='3'){?>
					 || <a class="mybutton"  onclick="goApply('<?=rows[i].itemId?>','<?=rows[i].itemName?>');">竞买人管理</a>
				<?}?>
				</td>
		</tr>
	<?}?>  		
	</script>
	
</div>
	
<!-- tab5  -->	
<div title="已结束的标的" style="padding:10px;">
	<div class="searchForm"><form id="endList_form">
		<input type="hidden" name="page"  value="1">
		<input type="hidden" name="rows"  value="5">
		<input type="hidden" name="sessionId"  value="${bidSession.sessionId}">
		标的名称：<input type="text" name="itemName"  value="" /> 
		<a class="easyui-linkbutton"  iconCls="icon-search" onclick="endListSearch();">查询</a>
		<a class="easyui-linkbutton"  iconCls="icon-search" onclick="clearFormById('endList_form');">清空</a>
	</form></div>
	<table id="endList_table" class="info" cellspacing="1" cellpadding="0">
		<tr class='active' id="title2" >
			<c:if test="${bidSession.serialCtrl=='T'}">
	   			<th width='3%'>序号</th>
			</c:if>	
		
			<th width='15%'>标的名称</th>
			<th width='8%'>起始价格</th>
			<th width='5%'>报价次数</th>
			<th width='10%'>最高报价</th>
			<th width='10%'>最高报价人</th>
			<th width='12%'>溢价率<br/>(最高价-起始价)/起始价</th>
			<th width='12%'>结束时间</th>		
			<th width='10%' class='th_center'>操作</th>
		</tr>
	</table>
	<div id="endList_page" class="page"></div>
	<script type="text/template" id="endList_html">
	<? for ( var i = 0; i < rows.length; i++) {?>
		<tr id=item_<?=rows[i].itemId?>>
			<c:if test="${bidSession.serialCtrl=='T'}">
	   			<td><?=rows[i].orderNumber?></td>
			</c:if>	
			<td title=<?=rows[i].itemName?>><?=strUtil.subStr(rows[i].itemName,20)?></td>
			<td><?=rows[i].firstValue?>  <?=rows[i].priceUnit?></td>
			<td><?=rows[i].bidTimes?></td>
			<td><?=rows[i].lastValue?>  <?=rows[i].priceUnit?></td>
			<td><?=strUtil.doNull(rows[i].userName)?></td>
			<td><?=rows[i].yjl?></td>
			<td><?=rows[i].closeTime?></td>
			<td>
				<!--<a class="mybutton"  onclick="restoreItem('<?=rows[i].itemId?>');">恢复</a>--> 
				<?if(rows[i].bidMode>0){?>				
					<a class="mybutton"  onclick="viewRecord('<?=rows[i].itemId?>');">报价记录</a>
				<?}?>
			</td>
		</tr>
	<?}?>  		
	</script>	
</div>

<!-- tab6  -->
<c:if test="${bidSession.sessionType!='3'}">
<!-- 只有专厅、专场才有此tab -->
<div title="${titleName}竞买人" style="padding:10px;">
	<div class="searchForm"><form id="applyList_form">
		<input type="hidden" name="page"  value="1">
		<input type="hidden" name="rows"  value="5">
		<input type="hidden" name="sessionId"  value="${bidSession.sessionId}">
		竞买人名称：<input type="text" name="userName"  value="" /> 
		<a class="easyui-linkbutton"  iconCls="icon-search" onclick="applyListSearch();">查询</a>
		<c:if test="${bidSession.sessionType!='3'}">
		
		</c:if>
		<a class="easyui-linkbutton"  iconCls="icon-add" onclick="addApply();">增加竞买人</a>
	</form></div>
	<table id="applyList_table" class="info" cellspacing="1" cellpadding="0">
		<tr class='active' id="title2" >
			<th width='15%'>竞买人登录名</th>
			<th width='10%'>姓名</th>
			<th width='10%'>电话</th>	
			<th width='10%'>邮箱</th>
			<c:if test="${bidSession.bailCtrl == '2'}">
				<th width='10%'>允许竞得数量</th>
			</c:if>
			<c:if test="${bidSession.bailCtrl == '3'}">
				<th width='10%'>实交保证金</th>
			</c:if>
			<th width='6%'>状态</th>
			<th width='15%' class='th_center'>操作</th>
		</tr>
	</table>
	<div id="applyList_page" class="page"></div>
	<script type="text/template" id="applyList_html">
	<? for ( var i = 0; i < rows.length; i++) {?>
		<tr>
			<td><?=rows[i].userName?></td>
			<td><?=rows[i].realName?></td>
			<td><?=rows[i].phone?></td>
			<td><?=rows[i].email?></td>
			<?if('${bidSession.bailCtrl}'=='2'){?><td><?=strUtil.doNull(rows[i].allowBuyNum)?></td><?}?>
			<?if('${bidSession.bailCtrl}'=='3'){?><td><?=strUtil.doNull(rows[i].factBail)?></td><?}?>
			<td><?=applayStatusText(rows[i].status)?></td>
			<td>
				<a class="mybutton"  onclick="viewApply('<?=rows[i].applyId?>');">查看</a>&nbsp;
				||&nbsp;<a class="mybutton"  onclick="openUpdateApply('${bidSession.bailCtrl}','<?=rows[i].applyId?>','<?=rows[i].realName?>','<?=rows[i].phone?>','<?=rows[i].email?>','<?=rows[i].status?>','<?=rows[i].allowBuyNum?>','<?=rows[i].factBail?>','<?=rows[i].factBailTime?>');">修改</a>&nbsp;
				||&nbsp;<a class="mybutton"  onclick="viewCache('<?=rows[i].userName?>','<?=rows[i].itemId?>','<?=rows[i].sessionId?>');">查缓存</a>
				<?if(rows[i].status == '0'){?>
                ||&nbsp;<a class="mybutton"  onclick="activateApply('<?=rows[i].applyId?>');">激活</a>
				<?}?>
			</td>
		</tr>
	<?}?>  		
	</script>
</div>
</c:if>

<!-- tab8  -->
<div title="交易须知与交易规则">
	<iframe id="rule-url" style="border:0px;width:100%;height:460px;"></iframe>
</div>

<!-- tab9  
<div title="通知单参数及模板设置" style="display:none;">
	<form id="paraForm">
	<input type="hidden" name="printId"  value="">
	<input type="hidden" name="sessionId"  value="${bidSession.sessionId}">
	<input type="hidden" name="sessionName"  value="${bidSession.sessionName}">
	<input type="hidden" name="itemId"  value="0">
	<input type="hidden" name="itemName"  value="--">
	<table class="info" cellspacing="1" cellpadding="0">
		<tr>
			<th>打印通知单模板：</th>
			<td><input type="text" required="true" name="templateId" id="templateCombo" value="" size="80"/> 
			</td>
		</tr>
		<tr>
			<th>价款支付期限：</th>
			<td><input type="text" name="itemPayDay" id="itemPayDay" value="" size="25" readonly="true" showSeconds="true" required="true" editable="false" class="easyui-datetimebox" /> </td>
		</tr>
		<tr>
			<th>交易价款结算场所：</th>
			<td><input type="text" name="payAddress"  value="" size="80" maxlength="55"  class="easyui-validatebox validatebox-text" 
			validtype="length[1,50]"	required="true"  missingMessage="请输入交易价款结算场所"  invalidMessage="最多可输入50个中文字符"  title="交易价款结算场所" /> </td>
		</tr>			
		<tr>
			<th>通知事项：</th>
			<td><textarea name="payNotice" cols="80"  rows="4"  value=""  maxlength="1000"  class="easyui-validatebox validatebox-text" 
			validtype="length[1,1000]"	required="true"  missingMessage="请输入通知事项"  invalidMessage="最多可输入1000个中文字符"  title="通知事项最多1000中文字符" ></textarea> </td>
		</tr>		<tr>			
			<td colspan="2" style="text-align:center;">
				<a class="easyui-linkbutton" iconCls="icon-add" onclick="savePara();">保存</a>
			</td>
		</tr>
	</table>
	</form>	
</div>-->
<!-- tab10 end -->
</div>
<!-- tab end  -->
<!-- 正文结束 -->
<%//@ include file="/common/top.jsp" %>
<!-- dialog1 查看报价记录 -->
<div id="jinjiaRecord_window" class="easyui-dialog" title="查看报价记录" modal="true" style="width:800px;height:400px" closed="true">
	<div class="searchForm"><form id="jinjiaRecord_form">
		<input type="hidden" name="page" value="1">
		<input type="hidden" name="rows" value="5">
		<input type="hidden" name="itemId" value="">
		报价人：<input type="text" name="userName"  value="" /> 
		<a class="easyui-linkbutton"  iconCls="icon-search" onclick="jinjiaRecordSearch();">查询</a>
	</form></div>
	<table id="jinjiaRecord_table" class="info" cellspacing="1" cellpadding="0">
		<tr class='active' id="title2" >
			<th width='5%'>报价序号</th>
			<th width='20%'>报价人</th>
			<th width='10%'>报价价格</th>	
			<th width='20%'>报价时间</th>
			<th width='15%'>报价人IP</th>
		</tr>
	</table>
	<div id="jinjiaRecord_page" class="page"></div>
	<script type="text/template" id="jinjiaRecord_html">
	<? for ( var i = 0; i < rows.length; i++) {?>
		<tr>
			<td><?=rows.length-i?></td>
			<td><?=rows[i].userName?></td>
			<td><?=rows[i].bidValue?></td>
			<td><?=rows[i].bidTime?></td>
			<td><?=rows[i].userIp?></td>
		</tr>
	<?}?>  		
	</script>
</div>
<!-- dialog2 设置竞买人 -->
<div id="ucUserList_window" class="easyui-dialog" title="设置竞买人-用户管理" modal="true" style="width:700px;height:400px;top:50px;" closed="true">
	<div class="searchForm"><form id="ucUserList_form">
		<input type="hidden" name="pageIndex"  value="1">
		<input type="hidden" name="pageSize"  value="5">
		<input type="hidden" name="sessionId"  value="${bidSession.sessionId}">
		登录名称：<input type="text" name="userEname"  value="" /> 
		<a class="easyui-linkbutton"  iconCls="icon-search" onclick="ucUserListSearch();">查询</a>
	</form></div>
	<table id="ucUserList_table" class="info" cellspacing="1" cellpadding="0">
		<tr class='active' id="title2" >
			<th width='20%'>登录名称</th>
			<th width='10%'>真实姓名</th>
			<th width='10%'>电话</th>
			<th width='10%'>邮箱</th>
			<th width='10%' class='th_center'>操作</th>
		</tr>
	</table>
	<div id="ucUserList_page" class="page"></div>
	<script type="text/template" id="ucUserList_html">
	<? for ( var i = 0; i < rows.length; i++) {?>
		<tr id=bill_<?=rows[i].billid?>>
			<td><?=rows[i].userEname?></td>
			<td><?=rows[i].userCname?></td>
			<td><?=rows[i].mobile?></td>
			<td><?=rows[i].email?></td>
			<td>
				<a class="mybutton"  onclick="setApply('<?=rows[i].userId?>','<?=rows[i].userEname?>','<?=rows[i].userCname?>','<?=rows[i].mobile?>','<?=rows[i].email?>');">设置为竞买人</a> 
				</td>
		</tr>
	<?}?>  		
	</script>
</div>
<!-- 标的竞买人管理窗口 -->
<div id="itemApplyList_window" class="easyui-dialog" title="标的竞买人管理" modal="true" style="width:900px;height:400px" closed="true">
	<div class="searchForm"><form id="applyItemList_form">
			<input type="hidden" name="page"  value="1">
			<input type="hidden" name="rows"  value="5">
			<input type="hidden" name="itemId"  value="0">
			竞买人登录名：<input type="text" name="userName"  value="" /> 
			<a class="easyui-linkbutton"  iconCls="icon-search" onclick="applyItemListSearch();">查询</a>
			<c:if test="${bidSession.sessionType!='3'}">
			
			</c:if>
			<a class="easyui-linkbutton"  iconCls="icon-add" onclick="addApply();">增加标的竞买人</a>
		</form></div>
		<table id="applyItemList_table" class="info" cellspacing="1" cellpadding="0">
			<tr class='active' id="title2" >
				<th width='20%'>竞买人登录名</th>
				<th width='10%'>姓名</th>
				<th width='10%'>电话</th>	
				<th width='10%'>邮箱</th>
				<th width='10%'>状态</th>
				<th width='16%' class='th_center'>操作</th>
			</tr>
		</table>
		<div id="applyItemList_page" class="page"></div>
		<script type="text/template" id="applyItemList_html">
	<? for ( var i = 0; i < rows.length; i++) {?>
		<tr>
			<td><?=rows[i].userName?></td>
			<td><?=rows[i].realName?></td>
			<td><?=rows[i].phone?></td>
			<td><?=rows[i].email?></td>
			<td><?=applayStatusText(rows[i].status)?></td>
			<td>
				<a class="mybutton"  onclick="viewApply('<?=rows[i].applyId?>');">查看</a>&nbsp;
				||&nbsp;<a class="mybutton"  onclick="openUpdateApply('${bidSession.bailCtrl}','<?=rows[i].applyId?>','<?=rows[i].realName?>','<?=rows[i].phone?>','<?=rows[i].email?>','<?=rows[i].status?>','<?=rows[i].allowBuyNum?>','<?=rows[i].factBail?>','<?=rows[i].factBailTime?>');">修改</a>&nbsp;
				||&nbsp;<a class="mybutton"  onclick="viewCache('<?=rows[i].userName?>','<?=rows[i].itemId?>','<?=rows[i].sessionId?>');">查缓存</a>
			<?if(rows[i].status == '0'){?>
                ||&nbsp;<a class="mybutton"  onclick="activateItemApply('<?=rows[i].applyId?>');">激活</a>
			<?}?>
			</td>
		</tr>
	<?}?>  		
	</script>
</div>
<!-- 竞买人信息完善窗口 -->
<div class="easyui-dialog" id="addApply_window" title="竞买人信息完善" closed="true" modal="true" style="width:500px;height:400px;top:20px;">
<form id="addApplyForm">
<table class="info" cellspacing="1" cellpadding="0" >
	<input type="hidden" name="sessionId" id="sessionId" value="${bidSession.sessionId}">
	<input type="hidden" name="userId" value="">
	<input type="hidden" name="itemId" value="0">
	<input type="hidden" name="objName" value="${bidSession.sessionName}">
	<input type="hidden" name="status" value="0">
	<input type="hidden" name="applyWay" value="1">
	<tr>
		<th>登录账户<font color="red">*</font></th>
		<td><input type="text" name="userName" style="border:0px #fff;" readonly="readonly" id="userName" /> </td>
	</tr>
	<tr>
		<th>姓名<font color="red">*</font></th>
		<td><input type="text" name="realName" class="easyui-validatebox validatebox-text" 
			validtype="length[1,33]"	required="true"  missingMessage="请输入联系人名称"  maxlength="100"
				invalidMessage="联系人名称1~33个字符"  title="请输入联系人名称"  value="1" size="30"/> </td>
	</tr>
	<tr>
		<th>手机<font color="red">*</font></th>
		<td><input type="text" name="phone" class="easyui-validatebox validatebox-text" 
			validtype="mobile"	required="true"  missingMessage="请填写手机号码"  maxlength="20"
				invalidMessage="请填写手机号码"  title="请填写手机号码"  value="1" size="30"/> </td>
	</tr>
	<tr>
		<th>邮箱<font color="red">*</font></th>
		<td><input type="text" name="email" class="easyui-validatebox validatebox-text" 
			validtype="email"	required="true"  missingMessage="请输入联系人邮箱"  maxlength="50"
				invalidMessage="请输入正确的邮箱格式"  title="请输入联系人邮箱"  value="1" size="30"/> </td>
	</tr>
	<c:if test="${bidSession.bailCtrl == '2'}">
	<tr>
		<th>竞得数量：</th>
		<td><input type="text" name="allowBuyNum"  value="0" maxlength="5" size="30" class="easyui-validatebox validatebox-text" 
				validtype="number"	required="true"/> </td>
	</tr>
	</c:if>
	<c:if test="${bidSession.bailCtrl == '3'}">
	<tr >
		<th>实交保证金：</th>
		<td><input type="text" name="factBail"  value="0" maxlength="20" size="30" class="easyui-validatebox validatebox-text" 
				validtype="number"	required="true"/> </td>
	</tr>
	</c:if>
	<tr >
		<th>保证金交纳时间：</th>
		<td><input type="text" name="factBailTime"  value="" size="25" readonly="true" showSeconds="true"  editable="false" class="easyui-datetimebox"  /></td>
	</tr>
	<tr>
		<td colspan="2" style="text-align:center;">
			<a class="easyui-linkbutton" id="addButton" iconCls="icon-add" onclick="saveApply();">设为竞买人</a>
		</td>
	</tr>
</table>
</form>
</div>

<!-- dialog3 比较窗口 -->
<div id="new-window" class="easyui-dialog" title="new" modal="true" style="width:960px;height:530px" closed="true">
<iframe id="new-window-url" style="border:0px;width:950px;height:460px;">
</iframe>
</div>

<!-- dialog3 开始窗口 -->
<div id="begin_window" class="easyui-dialog" title="new" modal="true" style="width:600px;height:330px" closed="true">
	<form id="beginForm">
		<input type="hidden" name="itemId" id="begin_itemId">
		<table class="info" cellspacing="1" cellpadding="0">
			<tr>
			<th>竞价开始时间：</th>
			<td><input type="hidden" name="OpenTimePre" id="beginOpenTime"  /> 
				<select class="myDate" size=1 id=beginOpenTime_y></select>年
				<select class="myDate" size=1 id=beginOpenTime_m></select>月
				<select class="myDate" size=1 id=beginOpenTime_d></select>日
				<select class="myTime" size=1 id=beginOpenTime_hh></select>时
				<select class="myTime" size=1 id=beginOpenTime_mm></select>分
				<select class="myTime" size=1 id=beginOpenTime_ss></select>秒
			</td>
			</tr>
			<tr>
			<th>限时开始时间：</th>
			<td><input type="hidden" name="firstBidTimePre" id="beginFirstBidTime"  /> 
				<select class="myDate" size=1 id=beginFirstBidTime_y></select>年
				<select class="myDate" size=1 id=beginFirstBidTime_m></select>月
				<select class="myDate" size=1 id=beginFirstBidTime_d></select>日
				<select class="myTime" size=1 id=beginFirstBidTime_hh></select>时
				<select class="myTime" size=1 id=beginFirstBidTime_mm></select>分
				<select class="myTime" size=1 id=beginFirstBidTime_ss></select>秒
			</td>
			</tr>
			<tr>
			<th>限时报价周期：</th>
			<td><input type="text" size="3" name="limitTime" value="${bidSession.limitTime }">(秒)</td>
			</tr>
			<tr>
				<td colspan="2" style="text-align:center;">
				<a class="easyui-linkbutton" id="beginButton" iconCls="icon-add" onclick="beginDo();">开始竞价</a>
				</td>
			</tr>			
		</table>
		
	</form>
</div>

<!-- dialog3 继续窗口 -->
<div id="continue_window" class="easyui-dialog" title="new" modal="true" style="width:600px;height:330px" closed="true">
	<form id="continueForm">
		<input type="hidden" name="itemId" id="continue_itemId">
		<table class="info" cellspacing="1" cellpadding="0">
			<tr>
			<th>限时开始时间：</th>
			<td><input type="hidden" name="firstBidTime" id="continueFirstBidTime"  /> 
				<select class="myDate" size=1 id=continueFirstBidTime_y></select>年
				<select class="myDate" size=1 id=continueFirstBidTime_m></select>月
				<select class="myDate" size=1 id=continueFirstBidTime_d></select>日
				<select class="myTime" size=1 id=continueFirstBidTime_hh></select>时
				<select class="myTime" size=1 id=continueFirstBidTime_mm></select>分
				<select class="myTime" size=1 id=continueFirstBidTime_ss></select>秒
			</td>
			</tr>
			<tr>
				<td colspan="2" style="text-align:center;">
				<a class="easyui-linkbutton" id="updateApplyButton" iconCls="icon-add" onclick="continueItemDo();">继续竞价</a>
				</td>
			</tr>			
		</table>
		
	</form>
</div>
<!-- dialog3 恢复窗口 -->
<div id="restore_window" class="easyui-dialog" title="new" modal="true" style="width:600px;height:330px" closed="true">
	<form id="restoreForm">
		<input type="hidden" name="itemId" id="restore_itemId">
		<table class="info" cellspacing="1" cellpadding="0">
			<tr>
			<th>竞价开始时间：</th>
			<td><input type="hidden" name="openTime" id="restoreOpenTime" /> 
				<select class="myDate" size=1 id=restoreOpenTime_y></select>年
				<select class="myDate" size=1 id=restoreOpenTime_m></select>月
				<select class="myDate" size=1 id=restoreOpenTime_d></select>日
				<select class="myTime" size=1 id=restoreOpenTime_hh></select>时
				<select class="myTime" size=1 id=restoreOpenTime_mm></select>分
				<select class="myTime" size=1 id=restoreOpenTime_ss></select>秒
			</td>
			</tr>
			<tr>
			<th>限时开始时间：</th>
			<td><input type="hidden" name="firstBidTime" id="restoreFirstBidTime"  /> 
				<select class="myDate" size=1 id="restoreFirstBidTime_y"></select>年
				<select class="myDate" size=1 id="restoreFirstBidTime_m"></select>月
				<select class="myDate" size=1 id="restoreFirstBidTime_d"></select>日
				<select class="myTime" size=1 id="restoreFirstBidTime_hh"></select>时
				<select class="myTime" size=1 id="restoreFirstBidTime_mm"></select>分
				<select class="myTime" size=1 id="restoreFirstBidTime_ss"></select>秒
			
			</td>
			</tr>
			<tr>
			<th>是否保留原来报价记录：</th>
			<td><input type="radio" name="record" value="T" checked="true"/>保留，
			<input type="radio" name="record" value="F" />不保留，
			</td>
			</tr>
			<tr>
				<td colspan="2" style="text-align:center;">
				<a class="easyui-linkbutton" id="updateApplyButton" iconCls="icon-add" onclick="restoreItemDo();">恢复</a>
				</td>
			</tr>			
		</table>
		
	</form>
</div>

<!-- 修改竞买人窗口 -->
<div class="easyui-dialog" id="updateApply_window" title="修改竞买人信息" closed="true" modal="true"  style="width:800px;height:350px;">
<form id="updateApplyForm">
<table class="info" cellspacing="1" cellpadding="0">
	<input type="hidden" name="applyId" id="applyId" value="">
	<tr>
		<th>姓名：</th>
		<td><input type="text" name="realName" id="realName"  size="30" maxlength="50" class="easyui-validatebox validatebox-text" required="true"/> </td>
	</tr>
	<tr>
		<th>电话：</th>
		<td><input type="text" name="phone" id="phone" size="30" maxlength="30" class="easyui-validatebox validatebox-text" required="true"/> </td>
	</tr>
	<tr>
		<th>邮箱：</th>
		<td><input type="text" name="email" id="email" maxlength="30" size="30" class="easyui-validatebox validatebox-text" required="true"/> </td>
	</tr>
	<c:if test="${bidSession.bailCtrl == '2'}">
	<tr>
		<th>拟竞拍数量：</th>
		<td><input type="text" name="allowBuyNum" id="allowBuyNum" maxlength="5" size="30" class="easyui-validatebox validatebox-text" 
				validtype="number"	required="true"/> </td>
	</tr>
	</c:if>
	<c:if test="${bidSession.bailCtrl == '3'}">
	<tr >
		<th>实交保证金：</th>
		<td><input type="text" name="factBail" id="factBail" maxlength="20" size="30" class="easyui-validatebox validatebox-text" 
				validtype="number"	required="true"/> </td>
	</tr>
	</c:if>
	<tr >
		<th>保证金交纳时间：</th>
		<td><input type="text" name="factBailTime" id="factBailTime"  value="" size="25" readonly="true" showSeconds="true"  editable="false" class="easyui-datetimebox"  /></td>
	</tr>
	<tr>
		<td colspan="2" style="text-align:center;">
			<a class="easyui-linkbutton" id="updateApplyButton" iconCls="icon-add" onclick="saveUpdateApply();">保存修改</a>
		</td>
	</tr>
</table>
</form>
</div>

<!-- 激活竞买人 -->
<div>
	<form id="activateApplyForm">
	<input type="hidden" name="applyId"  value="">
	<input type="hidden" name="status"  value="1">
	</form>
</div>

<!-- 激活标的竞买人 -->
<div>
	<form id="activateItemApplyForm">
	<input type="hidden" name="applyId"  value="">
	<input type="hidden" name="status"  value="1">
	</form>
</div>

<!-- 查看竞买人窗口Begin -->
<div class="easyui-dialog" id="viewApply_window" title="查看竞买人信息" closed="true" modal="true" style="width:800px;height:500px;">
<form id="viewApplyForm">
<table class="info" cellspacing="1" cellpadding="0">
	<tr>
		<th>姓名：</th>
		<td><input type="text" name="realName" size="30" style="border: 0px;" readonly="readonly" /> </td>
	</tr>
	<tr>
		<th>标的/活动名称：</th>
		<td><input type="text" name="objName" size="30" style="border: 0px;" readonly="readonly"/> </td>
	</tr>
	<tr>
		<th>报名方式：</th>
		<td><input type="radio" name="applyWay" value="1" disabled="disabled" />现场报名 &nbsp; &nbsp; &nbsp;
			<input type="radio" name="applyWay" value="0" disabled="disabled" />网上报名</td>
	</tr>
	<tr>
		<th>保证金支付方式：</th>
		<td><input type="radio" name="bailPayMode" value="0" disabled="disabled" />在线支付 &nbsp; &nbsp; &nbsp;
			<input type="radio" name="bailPayMode" value="1" disabled="disabled" />支票&nbsp; &nbsp; &nbsp;
			<input type="radio" name="bailPayMode" value="2" disabled="disabled" />银行转账&nbsp; &nbsp; &nbsp;
			<input type="radio" name="bailPayMode" value="3" disabled="disabled" />现金&nbsp; &nbsp; &nbsp;
			<input type="radio" name="bailPayMode" value="4" disabled="disabled" />其他&nbsp; &nbsp; &nbsp;
			</td>
	</tr>
	<tr>
		<th>应交保证金：</th>
		<td><input type="text" name="shouldBail"  size="30" style="border: 0px;" readonly="readonly"/> </td>
	</tr>
	<tr>
		<th>竞得数量：</th>
		<td><input type="text" name="allowBuyNum"  size="30" style="border: 0px;" readonly="readonly"/> </td>
	</tr>
	<tr >
		<th>实交保证金：</th>
		<td><input type="text" name="factBail"  size="30" style="border: 0px;" readonly="readonly"/> </td>
	</tr>
	<tr >
		<th>保证金交纳时间：</th>
		<td><input type="text" name="factBailTime"  value="" size="25" style="border: 0px;" readonly="readonly" /></td>
	</tr>
	<tr>
		<th>保证金状态：</th>
		<td><input type="radio" name="bailFinshFlag" value="0" disabled="disabled" />代交&nbsp; &nbsp; &nbsp;
			<input type="radio" name="bailFinshFlag" value="1" disabled="disabled" />部分交&nbsp; &nbsp; &nbsp;
			<input type="radio" name="bailFinshFlag" value="2" disabled="disabled" />全交&nbsp; &nbsp; &nbsp;
			<input type="radio" name="bailFinshFlag" value="3" disabled="disabled" />已退保&nbsp; &nbsp; &nbsp;
			</td>
	</tr>
	<tr>
		<th>状态：</th>
		<td>
			<input type="radio" name="status" value="0" disabled="disabled" />未激活 &nbsp; &nbsp; &nbsp;
			<input type="radio" name="status" value="1" disabled="disabled" />已激活
		 </td>
	</tr>
	<!-- <tr>
		<td colspan="2" style="text-align:center;">
			<a class="easyui-linkbutton" id="closeViewApplyWin" iconCls="icon-add" onclick="closeViewApplyWin();">关闭</a>
		</td>
	</tr> -->
</table>
</form>
</div>
<!-- 查看竞买人窗口End -->

<!-- 附件上传iframe元素 -->
<iframe name='uploadIframe' id='uploadIframe' frameborder='0' height='0' width='0'></iframe>
<div id="uploadIframeDefDiv" style="height:0px;" ></div>
<script type="text/javascript">
//附件上传回调方法
function myBack(){}
</script>
</body>
</html>

<script>
//是否动态报价控制 是否显示串行选项控制行
function setIfBidDynCtr(flag){
	if("T"==flag){
		//动态报价,不显示串行选项控制行，并且设置否
		if('${bidSession.sessionType}'=='2'){
		  $("#tr_serialCtrl").hide();
		  ZBXTools.initRadio("serialCtrl","F");
		  $("#tr_ifGroup").show();
		  $("#firstTime").val('5');
		  $("#firstTimeTxt").html('天');
		} else if('${bidSession.sessionType}'=='3'){
		  $("#firstTime").val('5');
		  $("#firstTimeTxt").html('天');
		}
	}else{
		//网络竞价，显示串行选项控制行
		if('${bidSession.sessionType}'=='2'){
		 $("#tr_serialCtrl").show();
		 line($("#updForm").find("input[name='serialCtrl']:checked").val());
		 $("#firstTime").val('60');
		 $("#firstTimeTxt").html('分钟');
		} else if('${bidSession.sessionType}'=='3'){
		  $("#firstTime").val('60');
		  $("#firstTimeTxt").html('分钟');
		}
	}
}

function line(flag){
	if("T"==flag){
		//动态报价,不显示串行选项控制行，并且设置否
		//$("#tr_zybjq").show();
		//$("#tr_xsbjzq").show();
		$("#tr_ifGroup").hide();
		ZBXTools.initRadio("ifGroup","F");
		$("#tr_xxsc").show();
	}else{
		//网络竞价，显示串行选项控制行
		//$("#tr_zybjq").hide();
		//$("#tr_xsbjzq").hide();
		$("#tr_ifGroup").show();
		$("#tr_xxsc").hide();
	}
}

function bcontrol(bn){
	var btxt ="";
	if(bn==2) btxt = "这里指的是每个标的需交纳的保证金数！";
	if(bn==3) btxt = "在选择3的情况下，不需要设置此项！";
	$("#bailFix_desc").html(btxt);
}

//===================更新===================
//打开更新页面
function editOpen(){
  if('${bidSession.sessionType}' =='2' || '${bidSession.sessionType}' =='3'){//专场、活动
   $('#sessionMode').combobox('setValue','${bidSession.sessionMode}');
  }
  
  //是否动态报价关联效果
  if(('${bidSession.sessionType}' =='2' ||'${bidSession.sessionType}' =='3') && '${bidSession.ifBidDyn}'== 'F') {
    setIfBidDynCtr('F');//[专场网络报价]
    if('${bidSession.serialCtrl}'=='T'){
       line('T');
    }else{
       line('F');
    }
  }else{
    setIfBidDynCtr('T');
  }
 
 
  initMyTime('sessionOpenTime','${bidSession.openTime}');
  $("#updTable").show();
  $("#upd_window").panel({title: "修改${titleName}信息"});
  $("#upd_window").dialog('open');
}

//更新提交
function edit(objId){
  //竞价方式校验及关联赋值
  /**
  var smode = "";
  setMyTime('sessionOpenTime');
  if('${bidSession.sessionType}'=='2'||'${bidSession.sessionType}'=='3'){ //专厅，竞价方式Radio;专场、活动，竞价方式下拉框
    smode = $('#sessionMode').combobox('getValue');
    if(smode==""||smode==null){
     alert("竞价方式不能为空！");
     return;
    }
  }else if('${bidSession.sessionType}'=='1'){
    smode = $('#updForm').find("input[name='sessionMode']:checked").val();
    if(smode==""||smode==null){
     alert("竞价方式不能为空！");
     return;
    }
    if(smode=="1"){
  	   $('#updForm').find("input[name='direction']").val("T");
    }else{
  	   $('#updForm').find("input[name='direction']").val("F");
    }
  }
 
  if('${bidSession.sessionType}'=='1'||'${bidSession.sessionType}'=='2'){ //专厅，对保证金等修改的校验；专场和活动没有此项
  	 var  bailCtrl =$("#updForm").find("input[name='bailCtrl']:checked").val();
	 if(bailCtrl == null || bailCtrl == "" ){
	   alert("保证金控制方式必选！");
	   return;
	 }
	  if(bailCtrl == "1" || bailCtrl=="2"){
	     if($("#bailFix").val()==null ||$("#bailFix").val()==""){
	        alert("保证金不能为空！");
	        return;
	     }
	  }else if(bailCtrl == "3"){
	     if($("#bailRate").val()==null ||$("#bailRate").val()==""){
	        alert("保证金比例不能为空！");
	        return;
	     }
	  }
  }
  
  var firstTime = $('#firstTime').val();
  if(firstTime == 0){
  	alert("自由报价期值不能为空或0！");
  	return;
  }
  
  var limitTimee = $('#limitTimee').val();
  if(limitTimee == 0){
  	alert("限时报价周期值不能为0！");
  	return;
  }
    **/
  editSubmit("session",objId,"updForm");
}
//更新后回调方法统一写在一个方法editCallBack中，通过objName来区分
//====================================================

//未开始的标的查询
function notBeginListSearch(){
    $("#notBeginList_form").find("input[name='currentTimePre']").val(getNowFormatDate());
	searchSubmit("item","notBeginList");
}
//进行中的标的查询
function runningListSearch(){
    $("#runningList_form").find("input[name='currentTimePre']").val(getNowFormatDate());
	searchSubmit("price","runningList");
}
//已结束的标的查询
function endListSearch(){
	searchSubmit("itemHistory","endList");
}
//竞买人查询
function applyListSearch(){
	searchSubmit("apply","applyList");
}
//标的竞买人查询
function applyItemListSearch(){
	searchSubmit("apply","applyItemList");
}
//已结束标的报价竞价记录查询
var sessionMode = '${bidSession.sessionMode}';
function jinjiaRecordSearch(){
    //alert(sessionMode);
    if(sessionMode == '1' || sessionMode == '2' || sessionMode == '7'){
      searchSubmit("jingjia","jinjiaRecord");
    }else if(sessionMode == '3' || sessionMode == '4' || sessionMode == '5' || sessionMode == '6'){
      searchSubmit("baojia","jinjiaRecord");
    }
}

//竞买人查看缓存
function viewCache(userName,itemId,sessionId){
	var ourl = ctx+spaceDomain  + "apply/compareApply?userName="+userName+"&itemId="+itemId+"&sessionId="+sessionId;
	$("#new-window-url").attr('src',ourl);
	$("#new-window").dialog({title:"比较竞买人的数据库和缓存内容"});
	$("#new-window").dialog('open');
}
//====================保存竞买人要求==================
function savePub(pubId){
//alert(pubId);
 var  auditLevel = $("input[name='auditLevel']:checked").val();
 if(auditLevel == null || auditLevel == "" ){
   alert("竞买人审核必选！");
   return;
 }
   editSubmit("pub",pubId,"addBuyerForm");
}

//保存竞买人要求回调方法
/* function editCallBack(flag,objName){
  if("T"==flag){
     //clearFormById("addBuyerForm");
     alert("保存竞买人要求成功！");
  }else{
     alert("保存竞买人要求失败！");
  }
} */


//UC中的用户查询
function ucUserListSearch(){
	//searchSubmit(objName,"ucUserList");
	searchUcUser("ucUserList");
}
//标的分组查询
function groupListSearch(){
	searchSubmit("group","groupList");
}
//打开设置竞买人的窗口
function addApply(){
	ucUserListSearch();
	$("#ucUserList_window").dialog('open');	
}
//打开设置竞买人信息的窗口
function setApply(userId,userEname,userCname,mobile,email){
	//<?=rows[i].userEname?>','<?=rows[i].userCname?>','<?=rows[i].mobile?>','<?=rows[i].email?>
	var addApplyformName = "addApplyForm";
	$('#'+addApplyformName).find("input[name='userId']").val(userId);
	$('#'+addApplyformName).find("input[name='userName']").val(userEname);
	$('#'+addApplyformName).find("input[name='realName']").val(userCname);
	$('#'+addApplyformName).find("input[name='phone']").val(mobile);
	$('#'+addApplyformName).find("input[name='email']").val(email);
	$('#'+addApplyformName).find("input[name='itemId']").val(itemApplyId);
	
	$("#addApply_window").dialog('open');	
}
//保存竞买人设置（联系方式）信息
function saveApply(){
	var addApplyformName = "addApplyForm";
	addSubmit("apply",addApplyformName);	
}
//打開竞买人修改窗口
function openUpdateApply(bailCtrl,applyId,realName,phone,email,status,allowBuyNum,factBail,factBailTime){
	var obj=new Object();
	obj.applyId=applyId;
	obj.realName=realName;
	obj.phone=phone;
	obj.email=email;
	obj.status=status;
	obj.allowBuyNum=strUtil.doNull(allowBuyNum,"");
	obj.factBail=strUtil.doNull(factBail,"");
	
	$("#updateApply_window").dialog('open');
	var updateApplyFormName = "updateApplyForm";
	clearFormById(updateApplyFormName);
	loadData(obj,updateApplyFormName);//给表单赋值
	if(factBailTime==null||factBailTime=="null"){
	  factBailTime="";
	}
	$("#factBailTime").datetimebox('setValue',factBailTime);
}

//激活竞买人
function activateApply(applyId){
  if(confirm("确定要激活竞买人吗？")){
    $("#activateApplyForm").find("input[name='applyId']").val(applyId);
	editSubmit('apply',applyId,'activateApplyForm');
  }
}

//激活标的竞买人
function activateItemApply(applyId){
  if(confirm("确定要激活竞买人吗？")){
    $("#activateItemApplyForm").find("input[name='applyId']").val(applyId);
	editSubmit('apply',applyId,'activateItemApplyForm');
  }
}

//查看竞买人信息
function viewApply(objId){
 getObj("apply",objId);
}

function getCallBack(flag,obj){
  if(flag == "T"){
	 clearFormById("viewApplyForm");
	 loadData(obj,"viewApplyForm");//给表单赋值
	 $("#viewApply_window").dialog('open');
  }else{
 	 alert("查询失败！");
  }
}

//保存修改竞买人信息
function saveUpdateApply(){
	var infoId = $("#updateApplyForm").find("input[name='applyId']").val();
	if(!strUtil.isNull(infoId)){
		editSubmit('apply',infoId,'updateApplyForm');		
	}else{
		alert("applyId不存在");
	}
}
//关闭查看竞买人信息窗口
function closeViewApplyWin(){
 $("#viewApply_window").dialog('close');
}

var manuBegin="F";
function notDefine(){
	if(manuBegin=="F"){
		manuBegin="T";
		$("#openTimePre_dt").hide();
		$("#firstBidTimePre_dt").hide();
		$("#defineTxt").html('现在设定竞价开始时间和结束时间');
	}else{
		manuBegin="F";
		$("#openTimePre_dt").show();
		$("#firstBidTimePre_dt").show();
		$("#defineTxt").html('待定: 以后再设定竞价开始时间和结束时间');
	}
	
}

//新增标的记录
function addItem(statusValue){
    $("#addItemButt").attr("disabled","disabled");
    $("#itemAddAndPub").attr("disabled","disabled");
	var addItemformName = "addItemForm";
	var fvalue = $('#'+addItemformName).find("input[name='firstValuePre']").val();
	$('#'+addItemformName).find("input[name='itemStatus']").val(statusValue);
	$('#'+addItemformName).find("input[name='incrementGroup']").val(fvalue);
	//校验标的分组下拉项
	if(manuBegin=="F"){
		setMyTime('openTimePre');//把竞价开始时间放到隐藏域中
		if($("#firstBidTimePre_y")){
			setMyTime('firstBidTimePre');
		}else{
			var fb = $('#openTimePre').val();
			$('#firstBidTimePre').val(fb);
		}
	}else{
		$("#openTimePre").val("2050-12-31 23:59:59");
		$("#firstBidTimePre").val("2050-12-31 23:59:59");
	}
	
	if("${bidSession.ifGroup}"== "T"){
		var groId = $('#groupIdCombo').combobox('getValue');
	    if(groId==""||groId==null){
	       alert("标的分组不能为空！");
	       return;
	    }
	}
	
    
    <c:if test="${bidSession.serialCtrl=='T'}">
    	if($("#orderNumber").val() !=1){
    		$('#openTimePre').val('2050-12-31 23:59:59');
    		$('#firstBidTimePre').val('2050-12-31 23:59:59');
    	}
    </c:if>
    var otp = $("#openTimePre").val();
	var fbtp = $("#firstBidTimePre").val();
	if(fbtp < otp){
		alert("限时开始时间不能早于竞价开始时间");
		return ;
	}
    
    if(sessionMode == '1' || sessionMode == '2' || sessionMode == '7'){
	    var limitTime = $('#limitTime').val();
		if(limitTime == 0){
			alert("限时报价周期值不能为0！");
			return;
		}
    }
	addSubmit("item",addItemformName);	
}

//新增分组记录
function addGroup(){
    if(confirm("确定要增加新的分组吗？")){
	  setMyTime('groupOpenTime');
	  addSubmit('group','groupAddForm');	
	}
}

//删除分组
function delGroup(objId){
	if(confirm("确定要删除吗？")){
		delSubmit("group",objId);
	}
}

function saveContent(formName){
	var infoId = $("#"+formName).find("input[name='infoId']").val();
	if(infoId==""){
		addSubmit('infoContent',formName);
	}else{
		editSubmit('infoContent',infoId,formName);
	}
}
//保存通知单模板及参数
function savePara(){
	var printId = $("#paraForm").find("input[name='printId']").val();
	if(printId==""){
		addSubmit('para','paraForm');
	}else{
		editSubmit('para',printId,'paraForm');
	}
}

//新增后回调方法
function addCallBack(flag,msg,objName){
	if(flag=="T"){
		alert("保存成功！");
		if(objName=="content"){
			$("#"+noticeOrRule+"_form").find("input[name='infoId']").val(msg);
		}else if(objName=="para"){
			//$("#paraForm").find("input[name='printId']").val(msg);
			//clearFormById("paraForm");
			window.location.reload(true);
		}else if(objName=="group"){
			groupListSearch();
		}else if(objName=="item"){
			if($("#orderNumber").val()){
				var orderNumber=parseInt($("#orderNumber").val())+1;
				checkNumber(orderNumber);
			    $("#orderNumber").val(orderNumber);
			    $("#orderNumberTxt").html(orderNumber);
			}
			$("#addItemButt").removeAttr("disabled","disabled");
			$("#itemAddAndPub").removeAttr("disabled","disabled");
		}else if(objName=="apply"){
			clearFormById('addApplyForm');
			$("#addApply_window").dialog('close');
			if(itemApplyId && itemApplyId!="0"){
				applyItemListSearch();
			}else{
				applyListSearch();
			}
		}else{
		}
	}else{
		alert("提交失败！"+msg);
	}
	
}

//交易须知与交易规则
function openRule(){
   var ruleUrl =ctx+spaceDomain+"content/list?objType=session&objId="+sessionId+"&direction="+direction;
   $("#rule-url").attr("src",ruleUrl);
}


//打开通知单参数及模板设置的TAB
var paraOpenFlag = "F";
function openPara(){
	if(paraOpenFlag=="F"){ //只执行一次
		paraOpenFlag="T";
		getPara("${bidSession.sessionId}","sessionId");
	}
	//initSelect();
}
function getParaBack(obj){
	if(obj.flag == "F"){
	  paraOpenFlag="F";
	  return "查询失败！";
	}
	var para = obj.entity;
	loadData(para,"paraForm");
	$("#paraForm").find("input[name='printId']").val(para.printId);
	if(paraOpenFlag=="T"){
		$("#templateCombo").combobox('setValue',para.templateId);//'${para.templateId}');
		$("#itemPayDay").datetimebox('setValue',para.itemPayDay);
	}
}
//更新后回调方法
function editCallBack(flag,objName,editForm){
	if(flag=="T"){
		//alert(objName);
		if(objName=="content"){
			alert("保存成功！");
		}else if(objName=="session"){
		   alert("修改成功！");
		   $("#upd_window").dialog('close');
		   window.location.reload(true);
		}else if(objName=="item"){
			 $("#begin_window").dialog('close');
			  alert("设置成功");
			  notBeginListSearch();
		}else if(objName=="pub"){
		  alert("操作成功！");
		  if("updBjserverForm"==editForm)window.location.reload(true);
		}else if(objName=="apply"){
		  if(editForm == "activateApplyForm"){
		    alert("竞买人激活成功！");
		    applyListSearch();
		    return;
		  }
		  if(editForm == "activateItemApplyForm"){
		    alert("竞买人激活成功！");
		    applyItemListSearch();
		    return;
		  }
		  alert("保存竞买人信息成功！");
		  clearFormById('updateApplyForm');
		  $("#updateApply_window").dialog('close');
		  if(itemApplyId && itemApplyId!="0"){
		   	applyItemListSearch();
		  }else{
		  	applyListSearch();
		  }
		}else if(objName=="para"){
		    var printId = $("#paraForm").find("input[name='printId']").val();
			getPara("${bidSession.sessionId}","sessionId");
			alert("修改成功！");
		}
	}else{
		alert("操作失败！");
	}
}

function beginIt(itemId,itemName){
	$("#begin_itemId").val(itemId);
	createMyTimeOption('beginOpenTime');
	createMyTimeOption('beginFirstBidTime');
	var firstTime="${bidSession.firstTime}";
	//alert(firstTime);
	var ss = firstTime * 60;
	var nowd = getNow();
	var nextd =getNextTime(nowd,ss);
	//alert(nextd);
	initMyTime('beginOpenTime',nowd);
	initMyTime('beginFirstBidTime',nextd);
	$("#begin_window").dialog({title:"设置【"+itemName+"】竞价开始时间"});
	$("#begin_window").dialog('open');
}
function beginDo(){
	var itemId = $("#begin_itemId").val();
	editSubmit("item",itemId,"beginForm");
}
//删除
function del(objId){
	if(confirm("确定要删除吗？")){
		delSubmit(objName,objId);
	}
}
//删除后回调方法
function delCallBack(flag,objName,msg){
	if(flag=="T"){
		if(objName=="group"){
		  alert("删除成功！");
		  groupListSearch();
		}else if(objName=="item"){
		  var pp = $('#main').tabs('getSelected');   
		  searchByTabtitle(pp.panel('options').title);//根据当前选项卡的title，执行相应search方法
		};
	}else{
		if(objName=="group"){
			alert(msg);
		}else{
			alert("删除失败！");
		}
	}
}

//根据当前选项卡的title，执行相应search方法
function searchByTabtitle(title){
   if("未开始的标的"==title){
		notBeginListSearch();
	}else if("进行中的标的"==title){
		runningListSearch();
	}else if("已结束的标的"==title){
		endListSearch();
	}
}

//reload当前tab列表数据
function currentTabListSearch(){
  var pp = $('#main').tabs('getSelected');   
  searchByTabtitle(pp.panel('options').title);//根据当前选项卡的title，执行相应search方法
}

function pubSession(){
	if(confirm("发布后网站上就可以看到了，确定要发布吗？")){
		//alert(sessionId);
		pubSessionSubmit(sessionId);
	}
}
function pubSessionBack(flag,msg){
	if(flag=="T"){
		//var ftxt = "已发布,<a onclick='pauseSession()'>暂停</a>"
		//$("#pubStatus").html(ftxt);
		initPubStatusTd("2");
		alert("已发布！");
		$("#itemAddAndPub").show();
	}else{
		alert("发布失败，"+msg);
	}
}
function pauseSession(){
	if(confirm("暂停后网站上就不能看到了，确定要暂停吗？")){
		pauseSessionSubmit(sessionId);
	}
}

function pauseSessionBack(flag,msg){
	if(flag=="T"){
		/* var ftxt = " 暂停中 <a style='color:red;' onclick='continueSession()'>重新发布</a> "+
			" <a style='color:red;' onclick='editBjserverOpen()'>修改报价服务器</a> ";
		$("#pubStatus").html(ftxt); */
		initPubStatusTd("3");
		$("#itemAddAndPub").hide();
	}else{
		alert("暂停操作失败，"+msg);
	}
}
function continueSession(){
	if(confirm("继续后网站上就可以看到了，确定要继续吗？")){
		
		continueSessionSubmit(sessionId);
	}
}
function continueSessionBack(flag,msg){
	if(flag=="T"){
		/* var ftxt = "已发布,<a onclick='pauseSession()'>暂停</a>"
		$("#pubStatus").html(ftxt); */
		initPubStatusTd("2");
		$("#itemAddAndPub").show();
	}else{
		alert("暂停操作失败，"+msg);
	}
}
function pubItem(itemId){
	if(!checkSesion())return;
	if(confirm("发布后网站上就可以看到该标的了，确定要发布吗？")){
		//alert(itemId);
		pubItemSubmit(itemId);
		notBeginListSearch();
	}	
}
function pubItemBack(flag,msg){
	if(flag=="T"){
		notBeginListSearch();
	}else{
		alert("发布失败，"+msg);
	}
}
function checkSesion(){
	if("${bidSession.status}"!=2){
		alert("此${titleName}未“发布”，请先处理！");
		return false;
	}
	return true;
}

function restoreItem(itemId){
	$("#restore_itemId").val(itemId);
	var nowd = getNowFormatDate();
	$("#restore_window").dialog('open');
	initMyTime('restoreFirstBidTime',nowd);
	initMyTime('restoreOpenTime',nowd);
	
}
function restoreItemDo(){
	if(confirm("此操作请慎重使用，确定要恢复吗？")){
		setMyTime('restoreFirstBidTime');
		restoreItemSubmit('restoreForm');
	}	
}

function restoreItemBack(flag,msg){
	if(flag=="T"){
		alert("已恢复");
		endListSearch();
	}else{
		alert("恢复失败，"+msg);
	}
}
function pauseItem(itemId){
	if(confirm("暂停后网站上不可以看到了，确定要暂停吗？")){
		pauseItemSubmit(itemId);
	}
}
function pauseItemBack(flag,msg){
	if(flag=="T"){
		alert("暂停操作完成");
		//notBeginListSearch();
		runningListSearch();
	}else{
		alert("暂停操作失败，"+msg);
	}
}
//暂停后的继续竞价
function continueItem(itemId,fbTime){
	$("#continue_itemId").val(itemId);
	initMyTime('continueFirstBidTime',fbTime);
	$("#continue_window").dialog('open');
}
function continueItemDo(){
	if(!checkSesion())return;
	if(confirm("继续后网站上就可以看到了，确定要继续吗？")){
		setMyTime('continueFirstBidTime');
		continueItemSubmit('continueForm');
	}
}
function continueItemBack(flag,msg){
	if(flag=="T"){
		alert("继续操作完成");
		//notBeginListSearch();
		runningListSearch();
		$("#continue_window").dialog('close');
	}else{
		alert("继续操作失败，"+msg);
	}
}
function viewRecord(itemId){
	$("#jinjiaRecord_form").find("input[name='itemId']").val(itemId);
	jinjiaRecordSearch();
	$("#jinjiaRecord_window").dialog("open");
}

//比缓存
function compareCache(itemId){
	//var ourl="${ctx}/sendPage/admin/viewJsp/compareItem?itemId="+itemId;
	//alert(ourl);
	var ourl = ctx+spaceDomain + "item/compareItem?itemId="+itemId+"&f="+new Date().getTime();
	$("#new-window-url").attr('src',ourl);
	$("#new-window").dialog({title:"比较标的的数据库和缓存内容"});
	$("#new-window").dialog('open');
}

//修改标的基本信息
function itemBase(itemId){
    $("new-window-url").html('');
    var ourl= ctx+spaceDomain+"item/itemBase?itemId="+itemId+"&ifGroup=${bidSession.ifGroup}";
    //alert(ourl);
	$("#new-window-url").attr('src',ourl);
	$("#new-window").dialog({title:"修改标的基本信息"});
	$("#new-window").dialog('open');
}

//关闭修改标的窗口
function closeItemWindow(){
  $("#new-window").dialog('close');
}

//修改标的高级规则
function itemRule(itemId,itemName){
    $("new-window-url").html('');
    var ourl= ctx+spaceDomain+"item/itemRule?itemId="+itemId+"&sessionMode=${bidSession.sessionMode}&sessionId=${bidSession.sessionId}&sessionType=${bidSession.sessionType}";
	//alert(ourl);
	$("#new-window-url").attr('src',ourl);
	$("#new-window").dialog({title:"修改【"+itemName+"】的高级规则"});
	$("#new-window").dialog('open');
}
//标的图
function goPic(itemId,itemName){
    $("new-window-url").html('');
    var ourl = "${atta_server}/attachment/store/list.action?objId="+itemId+"&objType=${atta_objType}";
	//alert(ourl);
	$("#new-window-url").attr('src',ourl);
	$("#new-window").dialog({title:"【"+itemName+"】图片管理"});
	$("#new-window").dialog('open');
}

//去报价
function goBaojia(itemId){
	var ourl="${ctx}/sendPage/admin/viewJsp/itemBaojia?itemId="+itemId;
	//alert(ourl);
	$("#new-window-url").attr('src',ourl);
	$("#new-window").dialog({title:"报价页面"});
	$("#new-window").dialog('open');
}
//去给标的添加竞买人
var itemApplyId="0";
function goApply(itemId,itemName){
	itemApplyId = itemId;
	$("#applyItemList_form").find("input[name='itemId']").val(itemId);
	$('#addApplyForm').find("input[name='objName']").val(itemName);
	applyItemListSearch();
	$("#itemApplyList_window").dialog('open');
}

//初始化新增标的表单
function initAdItemForm(){
    //初始化标的分组combobox
    initMyTime('openTimePre','${openTime}'); 
    initMyTime('firstBidTimePre','${firstBidTime}'); 
    if("${bidSession.ifGroup}"== "T"){
     objDataSelect("groupIdCombo","group","groupId","groupName","callBack","sessionId=${bidSession.sessionId}","initJSel");
    }
    jsonDataSelect("itemType","variety","","","");//初始化标的类型combobox 
    if('${Onum}'!=""){
    	checkNumber('${Onum}');
    }
}

//分组下拉框onSelect事件回调方法
function objSelectCallBack(obj,eleId,objName){
    //alert(obj.openTime);
	if(eleId =="groupIdCombo"){
	  $("#groupNameCombo").val(obj.groupName);
	  //$("#openTimePre").datetimebox('setValue',obj.openTime);
	  initMyTime('openTimePre',obj.openTime);
	 
	}
}



//分组combobox加载数据成功后赋初值回调方法
function oSelInitCallBack(data,eleId){
	for(var i in data){
		if(data[i].groupName == '默认分组')$('#'+eleId).combobox('setValue',data[i].groupId);
	}
}

//加载数据字典的回调方法
function dictOneCallBack(obj,elementId,cateEname){

 	if(obj.id=="1" || obj.id=="3" || obj.id=="5" || obj.id=="7"){
    	$('#updForm').find("input[name='direction']").val("T");
    }else if(obj.id=="2" || obj.id=="4" || obj.id=="6"){
    	$('#updForm').find("input[name='direction']").val("F");
    }
}

function initPubStatusTd(n){
	switch (n){
	    case '0':
	     $("#span_stat0").show();
	     $("#span_stat2").hide();
	     $("#span_stat3").hide();
	    break;
	    case '2':
		    $("#span_stat0").hide();
		    $("#span_stat2").show();
		    $("#span_stat3").hide();
	    break;
	    case '3':
		    $("#span_stat0").hide();
		    $("#span_stat2").hide();
		    $("#span_stat3").show();
	    break;
	}
}
			
//初始化加载
$(function(){
	initPubStatusTd("${bidSession.status}");
	$("#main").tabs({
		onSelect:function(title){
            if("新增标的" == title){
              initAdItemForm();
            }else if("未开始的标的"==title){
				notBeginListSearch();
			}else if("进行中的标的"==title){
				runningListSearch();
			}else if("已结束的标的"==title){
				endListSearch();
			}else if("${titleName}竞买人"==title){
				applyListSearch();
			}else if("${titleName}标的分组"==title){
				initMyTime('groupOpenTime','${bidSession.openTime}');
				groupListSearch();
			}else if("交易须知与交易规则"==title){
				openRule();
			}//else if("通知单参数及模板设置"==title){
				//openPara();
			//}
		}
	});
	 
	//初始化通知书模板下拉框
	jsonDataSelect("templateCombo","template","","orgId=${loginUser.orgId}","");
 	createMyTimeOption('openTimePre');
 	if("${bidSession.sessionMode}" != 7){
 	 createMyTimeOption('firstBidTimePre'); 
 	}
 	if("${bidSession.status}" == 0){
     createMyTimeOption('sessionOpenTime');
    }
  	if("${bidSession.ifGroup}" == "T"){
       createMyTimeOption('groupOpenTime');
  	}
    createMyTimeOption('continueFirstBidTime');
    createMyTimeOption('restoreOpenTime');
    createMyTimeOption('restoreFirstBidTime'); 
  
	if('${bidSession.sessionType}' =='2' || '${bidSession.sessionType}' =='3'){
	 loadDiceOneStep('sessionMode','bidMode',0,'${ctx}','','callBack');//专场、活动，竞价方式采用下拉框方式
	}
	 
	 loadDiceOneStep("currency","currency","0",'${ctx}','CNY');
});

function checkNumber(nn){
	if(nn==1){
		$("#firstBidTimePreTr").show();
		$("#openTimePreTr").show();
		//initMyTime('openTimePre','${openTime}'); 
	    //initMyTime('firstBidTimePre','${firstBidTime}'); 
	}else{
		$("#firstBidTimePreTr").hide();
		$("#openTimePreTr").hide();
		//$("#openTimePre").val("2050-12-31 23:59:59");
		//$("#firstBidTimePre").val("2050-12-31 23:59:59");
	}
}

function editPicOpen(){
  $("#sessPicSpan").hide();
  $("#updPicDiv").show();
}

function editPic(objId){
 editSubmit("session",objId,"updPicForm");
}

//报价服务器加载与否标识,在加载后的回调方法中赋值
var bjServerSFlag = "F";
//打开修改报价服务器项
function editBjserverOpen(){
   //本业务系统下拉数据
  if(bjServerSFlag == "F")jsonDataSelectAjax("bjServerStr","server","","callBack");
  $("#bjserverSpan").hide();
  $("#updBjserverDiv").show();
}

//提交修改报价服务器
function editBjserver(pubId){
 editSubmit("pub",pubId,"updBjserverForm");
}
//取消修改报价服务器
function cancelEditBjs(){
  $("#bjserverSpan").show();
  $("#updBjserverDiv").hide();
}

//反显报价服务器
function jsonSelAjaxCallBack(eleId,objName,data){
   bjServerSFlag ="T";
   $("#"+eleId).val("${bidPub.bjServer}"+":"+"${bidPub.bjPort}");
}

//选择报价服务器触发事件
function  bjServerChange(){
    var bjStr = $.trim($("#bjServerStr").val());
    $("#updBjserverForm").find("input[name='bjServer']").val((bjStr.split(":"))[0]);
    $("#updBjserverForm").find("input[name='bjPort']").val((bjStr.split(":"))[1]);
}
//小数位数变化(四舍五入)
function changeDecimal(id){
	var decimalCount = $("#decimalCount").val();
	var val = $('#'+id).val();	
	if(!isNaN(val)){
		 var result = Math.round(val * Math.pow(10, decimalCount)) / Math.pow(10, decimalCount);
		 $('#'+id).val(result);
	}
}
</script>